import React from 'react';

export default class extends React.Component{
  constructor(props){
    super();
    this.state={
      active:props.active,
      Change:props.Change
    }
  }
  UNSAFE_componentWillReceiveProps(props){
    this.setState({
      active:props.active,
    })
  }
  Triggle(){
    let active=this.state.active;
    if(active===undefined){
      active=false;
    }
    this.setState({
      active:!active
    },()=>{
      if(this.props.Change!==undefined ){
          this.props.Change();
      }
  });
  }
  render(){
    return(
      <svg id="已付款" xmlns="http://www.w3.org/2000/svg" onClick={e=>this.Triggle(e)} fill={this.state.active?"#5393eb":"#999"} width="46.458" height="46.432" viewBox="0 0 46.458 46.432">
      <path id="路径_3580" data-name="路径 3580" class="cls-1" d="M21.15,478.3H5.728a1.354,1.354,0,0,0,0,2.709H21.15a1.322,1.322,0,0,0,1.35-1.354,1.453,1.453,0,0,0-1.35-1.354Zm-6.748,6.19H5.728a1.354,1.354,0,0,0,0,2.709H14.4a1.321,1.321,0,0,0,1.35-1.354c.19-.58-.58-1.354-1.35-1.354Zm26.6,1.549v-1.162L35.8,479.653a1.5,1.5,0,0,0-2.12,2.127l2.505,2.516H27.706a1.355,1.355,0,0,0,0,2.709h8.289l-2.505,2.514a1.5,1.5,0,1,0,2.12,2.127l5.206-5.223v-.775c.193.582.193.387.193.387ZM9.969,490.677H5.728a1.354,1.354,0,0,0,0,2.709H9.969a1.32,1.32,0,0,0,1.35-1.354c.193-.58-.578-1.354-1.35-1.354Z" transform="translate(-4.186 -456.628)"/>
      <path id="路径_3581" data-name="路径 3581" class="cls-1" d="M45.062,11.906l-4.05-7.74A6.637,6.637,0,0,0,35.425.878H11.135A7.116,7.116,0,0,0,5.544,4.167L1.689,11.714A16.281,16.281,0,0,0,.146,17.9v1.16A1.321,1.321,0,0,0,1.5,20.416a1.492,1.492,0,0,0,1.543-1.355V17.515h40.48V43.053a1.32,1.32,0,0,1-1.35,1.354H4.582a1.319,1.319,0,0,1-1.35-1.354V41.311a1.319,1.319,0,0,0-1.35-1.355,1.319,1.319,0,0,0-1.35,1.355v1.742a4.288,4.288,0,0,0,4.243,4.256H42.362A4.287,4.287,0,0,0,46.6,43.053V18.1a16.282,16.282,0,0,0-1.543-6.19ZM3.809,14.615a13.038,13.038,0,0,1,.58-1.549L8.437,5.521a3.873,3.873,0,0,1,2.89-1.74H35.616a3.329,3.329,0,0,1,2.893,1.74l4.048,7.74a9.276,9.276,0,0,1,.575,1.355H3.811Z" transform="translate(-0.146 -0.878)"/>
    </svg>
    
    );
  }
}